package com.zgjkhis.modules.system.domain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * @Author yzq
 * @Description 盘点单
 * @Date 2021/6/23 9:38
 * @Param
 * @return
 **/
@Data
@TableName("his_drug_inventory")
public class DrugInventory implements Serializable {

    /**
     * 审核中
     */
    public static int STATUS_WAIT = 0;

    /**
     * 审核通过
     */
    public static int STATUS_ADOPT = 1;

    /**
     * 已取消
     */
    public static int STATUS_CANCEL = 2;

    @TableId
    @ApiModelProperty(value = "主键id(修改时必填)")
    private Long id;
    @ApiModelProperty(value = "盘点单号")
    private String inventoryNo;
    @ApiModelProperty(value = "盘点人")
    private String createUserId;
    @ApiModelProperty(value = "盘点人姓名")
    private String createUserName;
    @ApiModelProperty(value = "盈亏数量")
    private Integer profitLossNum;
    @ApiModelProperty(value = "盈亏成本金额")
    private BigDecimal profitLossPrincipal;
    @ApiModelProperty(value = "盈亏零售金额")
    private BigDecimal profitLossSales;
    @ApiModelProperty(value = "药房门店id")
    private String pharmacyId;
    @TableField(fill= FieldFill.INSERT)
    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date createTime;
    @ApiModelProperty(value = "0-审核中,1-已完成,2-已取消")
    private Integer status;
    @ApiModelProperty(value = "审核时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date examineTime;
    @ApiModelProperty(value = "审核人id")
    private String examineUserId;
    @ApiModelProperty(value = "审核人姓名")
    private String examineUserName;
    @ApiModelProperty(value = "盘点类型 1:中药饮片，2：配方颗粒，3：中成药，4：西药，5：耗材，6敷贴粉剂")
    private Integer inventoryType;
    public void copy(DrugInventory source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
